#ifndef KCPICKGRAYPHOTO_H
#define KCPICKGRAYPHOTO_H
#include "KvPhotoPickOp.h"


// 找灰度图片
class KcPickGrayPhoto : public KvPhotoPickOp
{
public:
    KcPickGrayPhoto(double pixTol, double grayTol)
        : pixTol_(pixTol), grayTol_(grayTol) {}

private:
    void doCalc_(const QString& filePath, void* fileObj) override;

private:
    bool isGrayscale_(const QImage& img) const;

private:
    double pixTol_{ 0 }; // 判断1个像素是否灰度值的容忍度, 取值[0, 1]
    double grayTol_{ 0 }; // 判读1幅图片是否灰度图的容忍度, 取值[0, 1]
};

#endif // KCPICKGRAYPHOTO_H
